<!doctype html>
<html>

<head>
	<meta charset="utf-8"> <!-- ://live.lyhuilin.com -->
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="full-screen" content="yes">
	<meta name="x5-fullscreen" content="true">
	<title>慧林淘友福利直播间【爆款秒杀，天天特价，好礼更多】</title>
	<link rel="canonical" href="http://live.lyhuilin.com" />
	<link rel='shortlink' href='http://live.lyhuilin.com' />
	<link rel="stylesheet" href="/static/layui.mobile.css">
	<link id="layuicss-skinlayim-mobilecss" rel="stylesheet" href="/static/layim.css" media="all">
	<link rel="stylesheet" href="/static/dropload.css">
	<script src="/static/jquery-1.11.0.min.js"></script>
	<script src="/static/dropload.min.js"></script>
	<script src="/static/jquery.lazyload.min.js"></script>
	<script src="/static/plugin/layer.js"></script>
</head>

<body>
	<div id="layui-m-layer1" class="layui-m-layer layui-m-layer1" index="1">
		<div class="layui-m-layermain">
			<div class="layui-m-layersection">
				<div class="layui-m-layerchild  layui-m-anim--1">
					<div class="layui-m-layercont">
						<div class="layim-panel layui-m-anim-left">
							<div class="layui-unselect layim-content">
								<div class="layim-chat layim-chat-friend">
									<div class="layim-chat-main inner" style="bottom:50px">
										<div style="color:#919191; line-height:25px; text-align:center; font-size:12px;">
											<span>下拉加载历史优惠</span>
										</div>
										<ul class="goods-two" ui-dragload data-callback="getLiveAjaxNew" data-url="" data-page="" data-minid=""
										 isLoad="false">
										</ul>
									</div>
								</div>
								<div class="layim-chat-footer" style="height:50px; background:#f5f5f5; left:0px; right:0px;">
									<div class="layim-chat-tool" style="height:50px; line-height:50px; font-size:16px; text-align:center;">
										<a href="https://s.click.taobao.com/GGHgFIw" style="color:#353535;text-align:center;">天猫国际：海量爆款，天天特价</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script>
		var goodsMinId = 0;//Date.parse(new Date());
		var goodsMaxId = 0;
		/*注入图片延迟插件*/
		$(function () {
			//$(".layim-chat-main").scrollTop( $(".layim-chat-main").scrollHeight);
			//$(".ui-lazyload").lazyload({effect: "fadeIn"});
			$("img").lazyload({ threshold: 180 });//在图片距离屏幕180px时提前载入
			$(".layim-chat-main").scrollTop(13500);
			var dropload = $('.inner').dropload({
				domUp: {
					domClass: 'dropload-up',
					domRefresh: '<div class="dropload-refresh">↓下拉加载历史优惠</div>',
					domUpdate: '<div class="dropload-update">↑释放加载历史优惠</div>',
					domLoad: '<div class="dropload-load"><span class="loading"></span>加载中...</div>'
				},
				domDown: {
					domClass: 'dropload-down',
					domRefresh: '<div class="dropload-refresh">↑上拉加载更多优惠</div>',
					domLoad: '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
					domNoData: '<div class="dropload-noData">暂无数据</div>'
				},
				loadUpFn: function (me) {
					$.ajax({
						type: 'GET',
						url: 'http://api.lyhuilin.com/live_json.php?miid=' + goodsMinId,
						dataType: 'json',
						success: function (data) {
							if (data.status == 0) {
								goodsMinId = data.minId;
								// 为了测试，延迟1秒加载
								setTimeout(function () {
									$('.goods-two').prepend(data.content);
									// 每次数据加载完，必须重置
									dropload.resetload();
								}, 1000);
							} else {
								if (data.minId > 0) {
									goodsMinId = data.minId;
								}
								dropload.resetload();
							}
						},
						error: function (xhr, type) {
							// 即使加载出错，也得重置						
							dropload.resetload();
						}
					});
				},
				loadDownFn: function (me) {
					$.ajax({
						type: 'GET',
						url: 'http://api.lyhuilin.com/live_json.php?maid=' + goodsMaxId,//live/json.json?
						dataType: 'json',
						success: function (data) {
							if (data.status == 0) {
								goodsMaxId = data.maxId;
								if (goodsMinId == 0) {
									goodsMinId = data.minId;
								}
								// 为了测试，延迟1秒加载
								setTimeout(function () {
									$('.goods-two').append(data.content);
									// 每次数据加载完，必须重置
									dropload.resetload();
								}, 1000);
							} else {
								dropload.resetload();
							}
						},
						error: function (xhr, type) {
							// 即使加载出错，也得重置
							dropload.resetload();
						}
					});
				}
			});
			dropload.unlock();
		});

		var showloadin = function () {
			layer.msg('正在为您领券中...');
		}
	</script>
	<div style="display:none">

	</div>
</body>

</html>